<?php
	$mode=$_GET['mode'];
	$obj=new Post();
	$obj->PostID=$_POST['PostID'];
	$obj->NewsTypeID=$_POST['NewsTypeID'];
	$obj->Title=$_POST['Title'];
	$obj->Summary=$_POST['Summary'];
	$obj->Detail=$_POST['Detail'];
	$obj->TitleEng=$_POST['TitleEng'];
	$obj->SummaryEng=$_POST['SummaryEng'];
	$obj->DetailEng=$_POST['DetailEng'];
	$obj->ImageID=$_POST['imageid'];
	$obj->ImagePath=$_POST['imagepath'];
	$obj->Source=$_POST['Source'];
	if($_POST['PostID']=="")
	{
		$obj->insert($conn);
		
	}
	else
	{
		$obj->update($conn);
		
	}
	
	$obj->updateImage($conn);
	
	$url="?module=banner&type=".$obj->NewsTypeID."&page=".$_SESSION['currentpage'];
	echo "<script language='JavaScript'> window.location = '".$url."'</script>";
?>